<template>
	<view>
		<uni-data-select :localdata="list" @change="change" placeholder="受理状态筛选"></uni-data-select>
		<u-card v-for="(item,index) in reactive" :thumb="base+item.avatarUrl" :title="item.lawyerName">
			<view slot="body">
				<view>法律专长：{{item.legalExpertiseName}}</view>
				<view>受理状态：{{item.state == 0?'未受理':'已受理'}}</view>
				<view>提交时间：{{item.createTime}}</view>
				<br>
				<button type="primary" @click="tozhu(item.id)">咨询</button>
			</view>
		</u-card>
		<u-card v-if="reactive.length == 0">暂无数据</u-card>
	</view>
</template>

<script>
	import api from 'commer/apiURL.js'
	export default {
		data() {
			return {
				base:api.baseurl,
				list:[ 
					{ text : '全部' , value : '全部' },
					{ text : '未受理' , value : '未受理' } ,
					{ text : '已受理' , value : '已受理' } ,
				],
				reactive:[],
			}
		},
		onLoad() {
			this.getin()
		},
		methods: {
			tozhu(id){
				uni.navigateTo({
					url:'zhixunxian?id='+id
				})
			},
			getin(index){
				this.$get(this.base+'/prod-api/api/lawyer-consultation/legal-advice/list',{
					state:index
				}).then((res)=>{		
					this.reactive = res.rows
				})
			},
			change(e){
				console.log(e)
				if(e == '未受理'){
					this.getin(0)
				}else if(e == '已受理'){
					this.getin(1)
				}else{
					this.getin()
				}
				
			}
		}
	}
</script>

<style>

</style>
